﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
        <link href="css/zTreeStyle/zTreeStyle.css" rel="stylesheet" />
    <link href="css/demo.css" rel="stylesheet" />
    <script src="Scripts/jquery-1.7.1.js"></script>
    <script src="js/jquery.ztree.all-3.5.js"></script>
    <script type="text/javascript">
        <!--
    var setting = {
        view: {
            showIcon: false
        },
        callback: {
            onRightClick: zTreeOnRightClick
        },
        check: {
            enable: true,
            nocheckInherit: true
        },
        data: {
            simpleData: {
                enable: true
            }

        }
    };

    var zNodes = [
        { "id": 1, "pId": 0, "name": "父节点1", menuUrl: "ddd" },
        { id: 11, pId: 1, name: "父节点11" },
        { id: 111, pId: 11, name: "叶子节点111", menuUrl: "ddd" },
        { id: 112, pId: 11, name: "叶子节点112" },
        { id: 113, pId: 11, name: "叶子节点113" },
        { id: 114, pId: 11, name: "叶子节点114" },
        { id: 12, pId: 1, name: "父节点12" },
        { id: 121, pId: 12, name: "叶子节点121" },
        { id: 122, pId: 12, name: "叶子节点122" },
        { id: 123, pId: 12, name: "叶子节点123" },
        { id: 124, pId: 12, name: "叶子节点124" },
        { id: 13, pId: 1, name: "父节点13" },
        { id: 2, pId: 0, name: "父节点2" },
        { id: 21, pId: 2, name: "父节点21"},
        { id: 211, pId: 21, name: "叶子节点211" },
        { id: 212, pId: 21, name: "叶子节点212" },
        { id: 213, pId: 21, name: "叶子节点213" },
        { id: 214, pId: 21, name: "叶子节点214" },
        { id: 22, pId: 2, name: "父节点22" },
        { id: 221, pId: 22, name: "叶子节点221" },
        { id: 222, pId: 22, name: "叶子节点222" },
        { id: 223, pId: 22, name: "叶子节点223" },
        { id: 224, pId: 22, name: "叶子节点224" },
        { id: 23, pId: 2, name: "父节点23" },
        { id: 231, pId: 23, name: "叶子节点231" },
        { id: 232, pId: 23, name: "叶子节点232" },
        { id: 233, pId: 23, name: "叶子节点233" },
        { id: 234, pId: 23, name: "叶子节点234" },
        { id: 3, pId: 0, name: "父节点3" }
    ];

    //[{id:0,pId:0,name:"网摘管理",menuUrl:"MarkManage/MarkList.aspx"},{id:2,pId:0,name:"网摘管理",menuUrl:"MarkManage/MarkList.aspx"},{id:3,pId:2,name:"网摘管理",menuUrl:"MarkManage/MarkList.aspx"},{id:4,pId:2,name:"顾客字典",menuUrl:"MarkManage/MarkList.aspx"},{id:5,pId:2,name:" 题图管理",menuUrl:"MarkManage/MarkList.aspx"},{id:6,pId:2,name:"列表样式",menuUrl:"MarkManage/MarkList.aspx"},{id:7,pId:0,name:"顾客字典",menuUrl:"MarkManage/MarkList.aspx"},{id:8,pId:7,name:"网摘管理",menuUrl:"MarkManage/MarkList.aspx"},{id:9,pId:7,name:"顾客字典",menuUrl:"MarkManage/MarkList.aspx"},{id:10,pId:7,name:" 题图管理",menuUrl:"MarkManage/MarkList.aspx"},{id:11,pId:7,name:"列表样式",menuUrl:"MarkManage/MarkList.aspx"},{id:12,pId:0,name:" 题图管理",menuUrl:"MarkManage/MarkList.aspx"},{id:13,pId:12,name:"网摘管理",menuUrl:"MarkManage/MarkList.aspx"},{id:14,pId:12,name:"顾客字典",menuUrl:"MarkManage/MarkList.aspx"},{id:15,pId:12,name:" 题图管理",menuUrl:"MarkManage/MarkList.aspx"},{id:16,pId:12,name:"列表样式",menuUrl:"MarkManage/MarkList.aspx"},{id:17,pId:0,name:"列表样式",menuUrl:"MarkManage/MarkList.aspx"},{id:18,pId:17,name:"网摘管理",menuUrl:"MarkManage/MarkList.aspx"},{id:19,pId:17,name:"顾客字典",menuUrl:"MarkManage/MarkList.aspx"},{id:20,pId:17,name:" 题图管理",menuUrl:"MarkManage/MarkList.aspx"},{id:21,pId:17,name:"列表样式",menuUrl:"MarkManage/MarkList.aspx"},{id:0,pId:0,name:"销售统计",menuUrl:"SalesManage/SalesList.aspx"},{id:23,pId:0,name:"销售管理",menuUrl:"SalesManage/SalesList.aspx"},{id:24,pId:23,name:"销售管理",menuUrl:"SalesManage/SalesList.aspx"},{id:25,pId:23,name:"销售统计",menuUrl:"SalesManage/SalesList.aspx"},{id:26,pId:0,name:"销售统计",menuUrl:"SalesManage/SalesList.aspx"},{id:27,pId:26,name:"销售管理",menuUrl:"SalesManage/SalesList.aspx"},{id:28,pId:26,name:"销售统计",menuUrl:"SalesManage/SalesList.aspx"},{id:0,pId:0,name:"产品管理",menuUrl:"ProductManage/ProductList.aspx"},{id:30,pId:0,name:"产品管理",menuUrl:"ProductManage/ProductList.aspx"},{id:31,pId:30,name:"产品管理",menuUrl:"ProductManage/ProductList.aspx"},{id:32,pId:30,name:"库存管理",menuUrl:"ProductManage/ProductList.aspx"},{id:33,pId:0,name:"库存管理",menuUrl:"ProductManage/ProductList.aspx"},{id:34,pId:33,name:"产品管理",menuUrl:"ProductManage/ProductList.aspx"},{id:35,pId:33,name:"库存管理",menuUrl:"ProductManage/ProductList.aspx"},{id:0,pId:0,name:"黑名单管理",menuUrl:"BlackManage/BlackList.aspx"},{id:37,pId:0,name:"黑名单管理",menuUrl:"BlackManage/BlackList.aspx"},{id:38,pId:37,name:"黑名单管理",menuUrl:"BlackManage/BlackList.aspx"},{id:0,pId:0,name:"系统管理",menuUrl:"Systems/SystemIndex.aspx "},{id:40,pId:0,name:"系统管理",menuUrl:"Systems/SystemIndex.aspx "},{id:41,pId:40,name:"系统管理",menuUrl:"Systems/SystemIndex.aspx "},{id:42,pId:40,name:"权限配置",menuUrl:"Systems/SystemIndex.aspx "},{id:43,pId:40,name:"系统日志",menuUrl:"Systems/SystemIndex.aspx "},{id:44,pId:40,name:"数据库管理",menuUrl:"Systems/SystemIndex.aspx "},{id:45,pId:0,name:"权限配置",menuUrl:"Systems/SystemIndex.aspx "},{id:46,pId:45,name:"系统管理",menuUrl:"Systems/SystemIndex.aspx "},{id:47,pId:45,name:"权限配置",menuUrl:"Systems/SystemIndex.aspx "},{id:48,pId:45,name:"系统日志",menuUrl:"Systems/SystemIndex.aspx "},{id:49,pId:45,name:"数据库管理",menuUrl:"Systems/SystemIndex.aspx "},{id:50,pId:0,name:"系统日志",menuUrl:"Systems/SystemIndex.aspx "},{id:51,pId:50,name:"系统管理",menuUrl:"Systems/SystemIndex.aspx "},{id:52,pId:50,name:"权限配置",menuUrl:"Systems/SystemIndex.aspx "},{id:53,pId:50,name:"系统日志",menuUrl:"Systems/SystemIndex.aspx "},{id:54,pId:50,name:"数据库管理",menuUrl:"Systems/SystemIndex.aspx "},{id:55,pId:0,name:"数据库管理",menuUrl:"Systems/SystemIndex.aspx "},{id:56,pId:55,name:"系统管理",menuUrl:"Systems/SystemIndex.aspx "},{id:57,pId:55,name:"权限配置",menuUrl:"Systems/SystemIndex.aspx "},{id:58,pId:55,name:"系统日志",menuUrl:"Systems/SystemIndex.aspx "},{id:59,pId:55,name:"数据库管理",menuUrl:"Systems/SystemIndex.aspx "}]

    $(document).ready(function () {
        var tree = $.fn.zTree.init($("#treeDemo"), setting, zNodes);
        $("#show").click(function () {
            var node = tree.getCheckedNodes();
            $.each(node, function () {
                alert(this.name);
            });
            //var node2 = tree.getChangeCheckedNodes();
            //$.each(node2, function () {
            //    alert(this.name);
            //});
        });
    });

    function zTreeOnRightClick() {

    }
    //-->
    </script>
</head>
<body>
    <div>
        <ul id="treeDemo" class="ztree"></ul>
    </div>
    <input type="button" id="show" value="ok" />
</body>
</html>
